{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">发货单号<strong>{$_REQUEST.id|getModelName='Shipping','mano'}</strong> 产品 [ <a href="__APP__/Shipping">返回发货单列表</a> ] 
<div class="btn-group pull-right">
	<button class="btn btn-primary" onclick="selProduct({$_REQUEST.id})"><i class="icon-search icon-white"></i> 选择产品</button>
</div>
  </h3>
<div id="result" class="result none"></div>
<ul id="myTab" class="nav nav-tabs">
	<li><a href="__URL__/edit/id/{$_REQUEST.id}">发货单概要</a></li>
	<li  class="active"><a href="#plist" data-toggle="tab">产品信息</a></li>
</ul>
<php>
	function getBuyId($orderdetail_id){
	$buyid = M('Buy')->where('order_detail_id = '.$orderdetail_id)->getField('id');
	return $buyid;
}
</php>
 <div id="myTabContent" class="tab-content">
            
	<div class="tab-pane fade in active" id="plist">
		<table class="table table-bordered table-striped">
			<tr><th>编号</th><th>销售分单号</th><th>订单要求</th> <th>产品中文</th><th>英文名称</th><th>CAS</th><th>数量</th><th>单价</th> <th>单位</th><th>货值</th><th>编辑</th><th>删除</th> </tr>
			<volist name="products" id="ca">
				<tr>
				<td>{$ca.id}</td>
				<?php $order_detail = M('Order_detail')->getById($ca['order_detail_id']); ?>
				<td>{$order_detail.mano}</td>
				<td>{$order_detail.order_id|getModelName='Order','remark'}</td>
				<php>
					$product = M('Product');
					$product->getById($ca['product_id']);
				</php>
				<td>{:$product->name}</td>
				<td>{:$product->ename}</td>
				<td>{:$product->cas}</td>
				<td>{$ca.number}</td>
				<td>{$order_detail.price}</td>
				<td>{$ca.order_detail_id|getModelName='Order_detail','unit_id'|getModelName='Unit'}</td>
				<td>{$ca.total}</td>
				<td><a href="__APP__/Shipping_detail/edit/id/{$ca.id}">编辑</a> </td>
				<td><a href="__APP__/Shipping_detail/foreverdelete/id/{$ca.id}">删除</a> </td>
			</tr>
			</volist>
		</table>
		<div class="page">{$page}</div>
	</div><!--profile-->

</div>
</div>
<include file="Public:footer" />
<load href="__PUBLIC__/Js/jquery-1.7.2.min.js"/>
<load href="__PUBLIC__/bootstrap/js/bootstrap-tab.js" />
<script type="text/javascript">
	function selProduct(id){
		if(id)
			 window.open(APP+'/Order_detail/search?form=form1&sid='+id,'selected','directorys=no,toolbar=no,status=no,menubar=no,resizable=yes,width=1000,height=800,top=100,left=120,scrollbars=yes');
		else
			alert("请选择发货单");
			return false;
	}

function addProduct(id){
		if(id)
			 location.href = APP+'/Product/add/supplier_id/'+id;
		else
			alert("请选择供应商");
			return false;
	}
</script>
